package com.baor.controller;


import com.baor.domain.CooperateVo;
import com.baor.domain.ParkingVo;
import com.baor.service.CooperateService;
import com.baor.utils.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/cooperate")
public class CooperateController {

    @Autowired
    private CooperateService cooperateService;

    @RequestMapping("/cooperateList")
    public AjaxResult<?> cooperateList(@RequestBody CooperateVo vo){
        return cooperateService.cooperateList(vo);
    }

    @RequestMapping("/insert")
    public AjaxResult<?> insert(@RequestBody CooperateVo cooperateVo){
        return cooperateService.insert(cooperateVo);
    }

    @RequestMapping("/info")
    public AjaxResult<?> info(@RequestBody CooperateVo vo){
        return cooperateService.info(vo.getCooperateId());
    }

    @RequestMapping("/update")
    public AjaxResult<?> update(@RequestBody CooperateVo vo){
        return cooperateService.update(vo);
    }

    @RequestMapping("/delete")
    public AjaxResult<?> delete(@RequestBody CooperateVo vo){
        return cooperateService.delete(vo.getCooperateId());
    }


    @RequestMapping("/search")
    public AjaxResult<?> search(@RequestBody CooperateVo vo){
        System.out.println(vo);
        return cooperateService.search(vo);
    }


}
